Rules for integrands of the form (((c+d x))^m) (((a+b Tan[e+f x]))^n)

1.  ∫(((c+d x))^m) (((b Tan[e+f x]))^n)dx

1:  ∫(((c+d x))^m) Tan[e+f x]dx  when  m∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Basis: Tan[z]==i-((2 i (e^(2 i z)))/(1+(e^(2 i z))))==-i+((2 i (e^(-2 i z)))/(1+(e^(-2 i z))))

Rule: If  m∈(SuperPlus[ℤ]), then

∫(((c+d x))^m) Tan[e+f x]dx  ⟶  ((i(((c+d x))^(m+1)))/(d(m+1)))-2i∫(((((c+d x))^m) (e^(2 i(e+f x))))/(1+(e^(2 i(e+f x)))))dx

∫(((c+d x))^m) Tan[e+f x]dx  ⟶  -((i(((c+d x))^(m+1)))/(d(m+1)))+2i∫(((((c+d x))^m) (e^(-2 i(e+f x))))/(1+(e^(-2 i(e+f x)))))dx

Program code:

Int[(c_.+d_.*x_)^m_.*tan[e_.+k_.*Pi+f_.*Complex[0,fz_]*x_],x_Symbol] :=
  -I*(c+d*x)^(m+1)/(d*(m+1)) + 2*I*Int[(c+d*x)^m*E^(-2*I*k*Pi)*E^(2*(-I*e+f*fz*x))/(1+E^(-2*I*k*Pi)*E^(2*(-I*e+f*fz*x))),x] /;
FreeQ[{c,d,e,f,fz},x] && IntegerQ[4*k] && IGtQ[m,0]

Int[(c_.+d_.*x_)^m_.*tan[e_.+k_.*Pi+f_.*x_],x_Symbol] :=
  I*(c+d*x)^(m+1)/(d*(m+1)) - 2*I*Int[(c+d*x)^m*E^(2*I*k*Pi)*E^(2*I*(e+f*x))/(1+E^(2*I*k*Pi)*E^(2*I*(e+f*x))),x] /;
FreeQ[{c,d,e,f},x] && IntegerQ[4*k] && IGtQ[m,0]

Int[(c_.+d_.*x_)^m_.*tan[e_.+f_.*Complex[0,fz_]*x_],x_Symbol] :=
  -I*(c+d*x)^(m+1)/(d*(m+1)) + 2*I*Int[(c+d*x)^m*E^(2*(-I*e+f*fz*x))/(1+E^(2*(-I*e+f*fz*x))),x] /;
FreeQ[{c,d,e,f,fz},x] && IGtQ[m,0]

Int[(c_.+d_.*x_)^m_.*tan[e_.+f_.*x_],x_Symbol] :=
  I*(c+d*x)^(m+1)/(d*(m+1)) - 2*I*Int[(c+d*x)^m*E^(2*I*(e+f*x))/(1+E^(2*I*(e+f*x))),x] /;
FreeQ[{c,d,e,f},x] && IGtQ[m,0]

2:  ∫(((c+d x))^m) (((b Tan[e+f x]))^n)dx  when  n>1 ∧ m>0

Derivation: Following rule inverted

Rule: If  n>1 ∧ m>0, then

∫(((c+d x))^m) (((b Tan[e+f x]))^n)dx  ⟶  
((b (((c+d x))^m) (((b Tan[e+f x]))^(n-1)))/(f(n-1)))-((b d m)/(f(n-1))) ∫(((c+d x))^(m-1)) (((b Tan[e+f x]))^(n-1))dx-(b^2) ∫(((c+d x))^m) (((b Tan[e+f x]))^(n-2))dx

Program code:

Int[(c_.+d_.*x_)^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  b*(c+d*x)^m*(b*Tan[e+f*x])^(n-1)/(f*(n-1)) - 
  b*d*m/(f*(n-1))*Int[(c+d*x)^(m-1)*(b*Tan[e+f*x])^(n-1),x] - 
  b^2*Int[(c+d*x)^m*(b*Tan[e+f*x])^(n-2),x] /;
FreeQ[{b,c,d,e,f},x] && GtQ[n,1] && GtQ[m,0]

3:  ∫(((c+d x))^m) (((b Tan[e+f x]))^n)dx  when  n<-1 ∧ m>0

Derivation: Algebraic expansion and integration by parts

Basis: (((b Tan[z]))^n)==((Sec[z])^2) (((b Tan[z]))^n)-((((b Tan[z]))^(n+2))/(b^2))

Basis: ((Sec[e+f x])^2) (((b Tan[e+f x]))^n)==(∂_x)((((b Tan[e+f x]))^(n+1))/(b f (n+1)))

Rule: If  n<-1 ∧ m>0, then

∫(((c+d x))^m) (((b Tan[e+f x]))^n)dx  ⟶  

∫(((c+d x))^m) ((Sec[e+f x])^2) (((b Tan[e+f x]))^n)dx-(1/(b^2))∫(((c+d x))^m) (((b Tan[e+f x]))^(n+2))dx  ⟶  

(((((c+d x))^m) (((b Tan[e+f x]))^(n+1)))/(b f(n+1)))-((d m)/(b f(n+1)))∫(((c+d x))^(m-1)) (((b Tan[e+f x]))^(n+1))dx-(1/(b^2))∫(((c+d x))^m) (((b Tan[e+f x]))^(n+2))dx

Program code:

Int[(c_.+d_.*x_)^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  (c+d*x)^m*(b*Tan[e+f*x])^(n+1)/(b*f*(n+1)) - 
  d*m/(b*f*(n+1))*Int[(c+d*x)^(m-1)*(b*Tan[e+f*x])^(n+1),x] - 
  1/b^2*Int[(c+d*x)^m*(b*Tan[e+f*x])^(n+2),x] /;
FreeQ[{b,c,d,e,f},x] && LtQ[n,-1] && GtQ[m,0]

2:  ∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  when  (m|n)∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Rule: If  (m|n)∈(SuperPlus[ℤ]), then

∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  ⟶  ∫(((c+d x))^m) ExpandIntegrand[(((a+b Tan[e+f x]))^n),x]dx

Program code:

Int[(c_.+d_.*x_)^m_.*(a_+b_.*tan[e_.+f_.*x_])^n_.,x_Symbol] :=
  Int[ExpandIntegrand[(c+d*x)^m,(a+b*Tan[e+f*x])^n,x],x] /;
FreeQ[{a,b,c,d,e,f,m},x] && IGtQ[m,0] && IGtQ[n,0]

3.  ∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  when  (a^2)+(b^2)==0 ∧ n∈(SuperMinus[ℤ])

1.  ∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  when  (a^2)+(b^2)==0

1:  ∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  when  (a^2)+(b^2)==0 ∧ m>0

Derivation: Algebraic expansion and integration by parts

Basis: If  (a^2)+(b^2)==0, then (1/(a+b Tan[z]))==(1/(2 a))+((a ((Sec[z])^2))/(2 (((a+b Tan[z]))^2)))

Basis: (((Sec[e+f x])^2)/(((a+b Tan[e+f x]))^2))==-(∂_x)(1/(b f (a+b Tan[e+f x])))

Rule: If  (a^2)+(b^2)==0 ∧ m>0, then

∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  ⟶  ((((c+d x))^(m+1))/(2 a d (m+1)))+(a/2) ∫(((((c+d x))^m) ((Sec[e+f x])^2))/(((a+b Tan[e+f x]))^2))dx
  ⟶  ((((c+d x))^(m+1))/(2 a d (m+1)))-((a(((c+d x))^m))/(2 b f (a+b Tan[e+f x])))+((a d m)/(2 b f)) ∫((((c+d x))^(m-1))/(a+b Tan[e+f x]))dx

Program code:

Int[(c_.+d_.*x_)^m_./(a_+b_.*tan[e_.+f_.*x_]),x_Symbol] :=
  (c+d*x)^(m+1)/(2*a*d*(m+1)) - 
  a*(c+d*x)^m/(2*b*f*(a+b*Tan[e+f*x])) + 
  a*d*m/(2*b*f)*Int[(c+d*x)^(m-1)/(a+b*Tan[e+f*x]),x] /;
FreeQ[{a,b,c,d,e,f},x] && EqQ[a^2+b^2,0] && GtQ[m,0]

2.  ∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  when  (a^2)+(b^2)==0 ∧ m<-1

1:  ∫(1/((((c+d x))^2) (a+b Tan[e+f x])))dx  when  (a^2)+(b^2)==0

Derivation: Integration by parts and algebraic expansion

Basis: (1/(((c+d x))^2))==-(∂_x)(1/(d (c+d x)))

Basis: If  (a^2)+(b^2)==0, then (∂_x)(1/(a+b Tan[e+f x]))==((f Cos[2 e+2 f x])/b)-((f Sin[2 e+2 f x])/a)

Rule: If  (a^2)+(b^2)==0, then

∫(1/((((c+d x))^2) (a+b Tan[e+f x])))dx  ⟶  -(1/(d (c+d x) (a+b Tan[e+f x])))+(f/(b d)) ∫((Cos[2 e+2 f x])/(c+d x))dx-(f/(a d)) ∫((Sin[2 e+2 f x])/(c+d x))dx

Program code:

Int[1/((c_.+d_.*x_)^2*(a_+b_.*tan[e_.+f_.*x_])),x_Symbol] :=
  -1/(d*(c+d*x)*(a+b*Tan[e+f*x])) + 
  f/(b*d)*Int[Cos[2*e+2*f*x]/(c+d*x),x] - 
  f/(a*d)*Int[Sin[2*e+2*f*x]/(c+d*x),x] /;
FreeQ[{a,b,c,d,e,f},x] && EqQ[a^2+b^2,0]

2:  ∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  when  (a^2)+(b^2)==0 ∧ m<-1 ∧ m≠-2

Derivation: Previous rule inverted

Rule: If  (a^2)+(b^2)==0 ∧ m<-1 ∧ m≠-2, then

∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  ⟶ ((f (((c+d x))^(m+2)))/(b (d^2) (m+1) (m+2)))+((((c+d x))^(m+1))/(d (m+1) (a+b Tan[e+f x])))+((2 b f)/(a d (m+1))) ∫((((c+d x))^(m+1))/(a+b Tan[e+f x]))dx

Program code:

Int[(c_.+d_.*x_)^m_/(a_+b_.*tan[e_.+f_.*x_]),x_Symbol] :=
  f*(c+d*x)^(m+2)/(b*d^2*(m+1)*(m+2)) + 
  (c+d*x)^(m+1)/(d*(m+1)*(a+b*Tan[e+f*x])) + 
  2*b*f/(a*d*(m+1))*Int[(c+d*x)^(m+1)/(a+b*Tan[e+f*x]),x] /;
FreeQ[{a,b,c,d,e,f},x] && EqQ[a^2+b^2,0] && LtQ[m,-1] && NeQ[m,-2]

x:  ∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  when  (a^2)+(b^2)==0 ∧ m<-1

Derivation: Previous rule inverted

Note: Although this rule unifies the above two rules, it requires an additional step and when m=-2 it generates two log terms that cancel out.

Rule: If  (a^2)+(b^2)==0 ∧ m<-1, then

∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  ⟶  ((((c+d x))^(m+1))/(d (m+1) (a+b Tan[e+f x])))+(f/(b d (m+1))) ∫(((c+d x))^(m+1))dx+((2 b f)/(a d (m+1))) ∫((((c+d x))^(m+1))/(a+b Tan[e+f x]))dx

Program code:

(* Int[(c_.+d_.*x_)^m_/(a_+b_.*tan[e_.+f_.*x_]),x_Symbol] :=
  (c+d*x)^(m+1)/(d*(m+1)*(a+b*Tan[e+f*x])) + 
  f/(b*d*(m+1))*Int[(c+d*x)^(m+1),x] + 
  2*b*f/(a*d*(m+1))*Int[(c+d*x)^(m+1)/(a+b*Tan[e+f*x]),x] /;
FreeQ[{a,b,c,d,e,f},x] && EqQ[a^2+b^2,0] && LtQ[m,-1] *)

3:  ∫(1/((c+d x) (a+b Tan[e+f x])))dx  when  (a^2)+(b^2)==0

Derivation: Algebraic expansion

Basis: If  (a^2)+(b^2)==0, then (1/(a+b Tan[z]))==(1/(2 a))+((Cos[2 z])/(2 a))+((Sin[2 z])/(2 b))

Rule: If  (a^2)+(b^2)==0, then

∫(1/((c+d x) (a+b Tan[e+f x])))dx  ⟶  ((Log[c+d x])/(2 a d))+(1/(2 a)) ∫((Cos[2 e+2 f x])/(c+d x))dx+(1/(2 b)) ∫((Sin[2 e+2 f x])/(c+d x))dx

Program code:

Int[1/((c_.+d_.*x_)*(a_+b_.*tan[e_.+f_.*x_])),x_Symbol] :=
  Log[c+d*x]/(2*a*d) + 
  1/(2*a)*Int[Cos[2*e+2*f*x]/(c+d*x),x] + 
  1/(2*b)*Int[Sin[2*e+2*f*x]/(c+d*x),x] /;
FreeQ[{a,b,c,d,e,f},x] && EqQ[a^2+b^2,0]

4:  ∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  when  (a^2)+(b^2)==0 ∧ m∉ℤ

Derivation: Algebraic expansion

Basis: If  (a^2)+(b^2)==0, then (1/(a+b Tan[z]))==(1/(2 a))+((e^((2 a z)/b))/(2 a))

Rule: If  (a^2)+(b^2)==0 ∧ m∉ℤ, then

∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  ⟶  ((((c+d x))^(m+1))/(2 a d (m+1)))+(1/(2 a)) ∫(((c+d x))^m) (e^(((2 a)/b)(e+f x)))dx

Program code:

Int[(c_.+d_.*x_)^m_/(a_+b_.*tan[e_.+f_.*x_]),x_Symbol] :=
  (c+d*x)^(m+1)/(2*a*d*(m+1)) + 
  1/(2*a)*Int[(c+d*x)^m*E^(2*a/b*(e+f*x)),x] /;
FreeQ[{a,b,c,d,e,f,m},x] && EqQ[a^2+b^2,0] && Not[IntegerQ[m]]

2:  ∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  when  (a^2)+(b^2)==0 ∧ (m|n)∈(SuperMinus[ℤ])

Derivation: Algebraic expansion

Basis: If  (a^2)+(b^2)==0, then (1/(a+b Tan[z]))==(1/(2 a))+((Cos[2 z])/(2 a))+((Sin[2 z])/(2 b))

Rule: If  (a^2)+(b^2)==0 ∧ (m|n)∈(SuperMinus[ℤ]), then

∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  ⟶   ∫(((c+d x))^m) ExpandIntegrand[((((1/(2 a))+((Cos[2 e+2 f x])/(2 a))+((Sin[2 e+2 f x])/(2 b))))^(-n)),x]dx

Program code:

Int[(c_.+d_.*x_)^m_*(a_+b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  Int[ExpandIntegrand[(c+d*x)^m,(1/(2*a)+Cos[2*e+2*f*x]/(2*a)+Sin[2*e+2*f*x]/(2*b))^(-n),x],x] /;
FreeQ[{a,b,c,d,e,f},x] && EqQ[a^2+b^2,0] && ILtQ[m,0] && ILtQ[n,0]

3:  ∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  when  (a^2)+(b^2)==0 ∧ n∈(SuperMinus[ℤ])

Derivation: Algebraic expansion

Basis: If  (a^2)+(b^2)==0, then (1/(a+b Tan[z]))==(1/(2 a))+((e^((2 a z)/b))/(2 a))

Rule: If  (a^2)+(b^2)==0 ∧ n∈(SuperMinus[ℤ]), then

∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  ⟶  ∫(((c+d x))^m) ExpandIntegrand[((((1/(2 a))+((e^(((2 a)/b)(e+f x)))/(2 a))))^(-n)),x]dx

Program code:

Int[(c_.+d_.*x_)^m_*(a_+b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  Int[ExpandIntegrand[(c+d*x)^m,(1/(2*a)+E^(2*a/b*(e+f*x))/(2*a))^(-n),x],x] /;
FreeQ[{a,b,c,d,e,f,m},x] && EqQ[a^2+b^2,0] && ILtQ[n,0]

4:  ∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  when  (a^2)+(b^2)==0 ∧ n+1∈(SuperMinus[ℤ])∧ m>0

Derivation: Integration by parts

Note: If  (a^2)+(b^2)==0 ∧ n∈(SuperMinus[ℤ]), then ∫(((a+b Tan[e+f x]))^n)dx is a monomial in x plus terms of the form g (((a+b Tan[e+f x]))^k) where n≤k<0.

Rule: If  (a^2)+(b^2)==0 ∧ n+1∈(SuperMinus[ℤ])∧ m>0, let u=∫(((a+b Tan[e+f x]))^n)dx, then

∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  ⟶  u (((c+d x))^m)-d m ∫u (((c+d x))^(m-1)) dx

Program code:

Int[(c_.+d_.*x_)^m_.*(a_+b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  With[{u=IntHide[(a+b*Tan[e+f*x])^n,x]},
  Dist[(c+d*x)^m,u,x] - d*m*Int[Dist[(c+d*x)^(m-1),u,x],x]] /;
FreeQ[{a,b,c,d,e,f},x] && EqQ[a^2+b^2,0] && ILtQ[n,-1] && GtQ[m,0]

4.  ∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  when  (a^2)+(b^2)≠0 ∧ n∈(SuperMinus[ℤ])∧ m∈(SuperPlus[ℤ])

1:  ∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  when  (a^2)+(b^2)≠0 ∧ m∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Basis: (1/(a+b Tan[z]))==(1/(a+i b))+((2 i b (e^(2 i z)))/((((a+i b))^2)+((a^2)+(b^2)) (e^(2 i z))))

Rule: If  (a^2)+(b^2)≠0 ∧ m∈(SuperPlus[ℤ]), then

∫((((c+d x))^m)/(a+b Tan[e+f x]))dx  ⟶  ((((c+d x))^(m+1))/(d(m+1) (a+i b)))+2 i b ∫(((((c+d x))^m) (e^(2 i (e+f x))))/((((a+i b))^2)+((a^2)+(b^2)) (e^(2 i (e+f x)))))dx

Program code:

Int[(c_.+d_.*x_)^m_./(a_+b_.*tan[e_.+k_.*Pi+f_.*x_]),x_Symbol] :=
  (c+d*x)^(m+1)/(d*(m+1)*(a+I*b)) + 
  2*I*b*Int[(c+d*x)^m*E^(2*I*k*Pi)*E^Simp[2*I*(e+f*x),x]/((a+I*b)^2+(a^2+b^2)*E^(2*I*k*Pi)*E^Simp[2*I*(e+f*x),x]),x] /;
FreeQ[{a,b,c,d,e,f},x] && IntegerQ[4*k] && NeQ[a^2+b^2,0] && IGtQ[m,0]

Int[(c_.+d_.*x_)^m_./(a_+b_.*tan[e_.+f_.*x_]),x_Symbol] :=
  (c+d*x)^(m+1)/(d*(m+1)*(a+I*b)) + 
  2*I*b*Int[(c+d*x)^m*E^Simp[2*I*(e+f*x),x]/((a+I*b)^2+(a^2+b^2)*E^Simp[2*I*(e+f*x),x]),x] /;
FreeQ[{a,b,c,d,e,f},x] && NeQ[a^2+b^2,0] && IGtQ[m,0]

2:  ∫((c+d x)/(((a+b Tan[e+f x]))^2))dx  when  (a^2)+(b^2)≠0

Rule: If  (a^2)+(b^2)≠0, then

∫((c+d x)/(((a+b Tan[e+f x]))^2))dx  ⟶  -((((c+d x))^2)/(2 d ((a^2)+(b^2))))-((b (c+d x))/(f ((a^2)+(b^2)) (a+b Tan[e+f x]))) +(1/(f ((a^2)+(b^2))))∫((b d+2 a c f+2 a d f x)/(a+b Tan[e+f x]))dx

Program code:

Int[(c_.+d_.*x_)/(a_+b_.*tan[e_.+f_.*x_])^2,x_Symbol] :=
  -(c+d*x)^2/(2*d*(a^2+b^2)) - 
  b*(c+d*x)/(f*(a^2+b^2)*(a+b*Tan[e+f*x])) + 
  1/(f*(a^2+b^2))*Int[(b*d+2*a*c*f+2*a*d*f*x)/(a+b*Tan[e+f*x]),x] /;
FreeQ[{a,b,c,d,e,f},x] && NeQ[a^2+b^2,0]

3:  ∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  when  (a^2)+(b^2)≠0 ∧ n∈(SuperMinus[ℤ])∧ m∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Basis: (1/(a+b Tan[z]))==(1/(a-i b))-((2 i b)/((a^2)+(b^2)+(((a-i b))^2) (e^(2 i z))))

Basis: (1/(a+b Cot[z]))==(1/(a+i b))+((2 i b)/((a^2)+(b^2)-(((a+i b))^2) (e^(2 i z))))

Rule: If  (a^2)+(b^2)≠0 ∧ n∈(SuperMinus[ℤ])∧ m∈(SuperPlus[ℤ]), then

∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  ⟶  ∫(((c+d x))^m) ExpandIntegrand[((((1/(a-i b))-((2 i b)/((a^2)+(b^2)+(((a-i b))^2) (e^(2 i (e+f x)))))))^(-n)),x]dx

Program code:

Int[(c_.+d_.*x_)^m_.*(a_+b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  Int[ExpandIntegrand[(c+d*x)^m,(1/(a-I*b)-2*I*b/(a^2+b^2+(a-I*b)^2*E^(2*I*(e+f*x))))^(-n),x],x] /;
FreeQ[{a,b,c,d,e,f},x] && NeQ[a^2+b^2,0] && ILtQ[n,0] && IGtQ[m,0]

5.  ∫(c+d x) (Sqrt[a+b Tan[e+f x]])dx

1:  ∫(c+d x) (Sqrt[a+b Tan[e+f x]])dx  when  (a^2)+(b^2)==0

Derivation: Integration by parts

Basis: If  (a^2)+(b^2)==0, then (Sqrt[a+b Tan[e+f x]])==-(∂_x)(((Sqrt[2]) b ArcTanh[((Sqrt[a+b Tan[e+f x]])/((Sqrt[2]) (Sqrt[a])))])/((Sqrt[a]) f))

Rule: If  (a^2)+(b^2)==0, then

∫(c+d x) (Sqrt[a+b Tan[e+f x]])dx  ⟶  -(((Sqrt[2]) b (c+d x) ArcTanh[((Sqrt[a+b Tan[e+f x]])/((Sqrt[2]) (Sqrt[a])))])/((Sqrt[a]) f))+(((Sqrt[2]) b d)/((Sqrt[a]) f)) ∫ArcTanh[((Sqrt[a+b Tan[e+f x]])/((Sqrt[2]) (Sqrt[a])))]dx

Program code:

Int[(c_.+d_.*x_)*Sqrt[a_+b_.*tan[e_.+f_.*x_]],x_Symbol] :=
  -Sqrt[2]*b*(c+d*x)*ArcTanh[Sqrt[a+b*Tan[e+f*x]]/(Sqrt[2]*Rt[a,2])]/(Rt[a,2]*f) + 
  Sqrt[2]*b*d/(Rt[a,2]*f)*Int[ArcTanh[Sqrt[a+b*Tan[e+f*x]]/(Sqrt[2]*Rt[a,2])],x] /;
FreeQ[{a,b,c,d,e,f},x] && EqQ[a^2+b^2,0]

2:  ∫(c+d x) (Sqrt[a+b Tan[e+f x]])dx  when  (a^2)+(b^2)≠0

Derivation: Integration by parts

Basis: (Sqrt[a+b Tan[e+f x]])==-((i (Sqrt[a-i b]))/f) (∂_x)ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a-i b]))]+((i (Sqrt[a+i b]))/f) (∂_x)ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a+i b]))]

Rule: If  (a^2)+(b^2)≠0, then

∫(c+d x) (Sqrt[a+b Tan[e+f x]])dx  ⟶  
-((i (Sqrt[a-i b]) (c+d x))/f) ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a-i b]))]+((i (Sqrt[a+i b]) (c+d x))/f) ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a+i b]))]+
((i d (Sqrt[a-i b]))/f) ∫ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a-i b]))]dx-((i d (Sqrt[a+i b]))/f) ∫ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a+i b]))]dx

Program code:

Int[(c_.+d_.*x_)*Sqrt[a_.+b_.*tan[e_.+f_.*x_]],x_Symbol] :=
  -I*Rt[a-I*b,2]*(c+d*x)/f*ArcTanh[Sqrt[a+b*Tan[e+f*x]]/Rt[a-I*b,2]] + 
  I*Rt[a+I*b,2]*(c+d*x)/f*ArcTanh[Sqrt[a+b*Tan[e+f*x]]/Rt[a+I*b,2]] + 
  I*d*Rt[a-I*b,2]/f*Int[ArcTanh[Sqrt[a+b*Tan[e+f*x]]/Rt[a-I*b,2]],x] - 
  I*d*Rt[a+I*b,2]/f*Int[ArcTanh[Sqrt[a+b*Tan[e+f*x]]/Rt[a+I*b,2]],x] /;
FreeQ[{a,b,c,d,e,f},x] && NeQ[a^2+b^2,0]

6.  ∫((c+d x)/(Sqrt[a+b Tan[e+f x]]))dx

1:  ∫((c+d x)/(Sqrt[a+b Tan[e+f x]]))dx  when  (a^2)+(b^2)==0

Derivation: Algebraic expansion

Basis: If  (a^2)+(b^2)==0, then ((c+d x)/(Sqrt[a+b Tan[z]]))==(((c+d x) (Sqrt[a+b Tan[z]]))/(2 a))+((a (c+d x) ((Sec[z])^2))/(2 (((a+b Tan[z]))^(3/2))))

Rule: If  (a^2)+(b^2)==0, then

∫((c+d x)/(Sqrt[a+b Tan[e+f x]]))dx  ⟶ (1/(2 a))∫(c+d x) (Sqrt[a+b Tan[e+f x]])dx+(a/2) ∫(((c+d x) ((Sec[e+f x])^2))/(((a+b Tan[e+f x]))^(3/2)))dx

Program code:

Int[(c_.+d_.*x_)/Sqrt[a_+b_.*tan[e_.+f_.*x_]],x_Symbol] :=
  1/(2*a)*Int[(c+d*x)*Sqrt[a+b*Tan[e+f*x]],x] + 
  a/2*Int[(c+d*x)*Sec[e+f*x]^2/(a+b*Tan[e+f*x])^(3/2),x] /;
FreeQ[{a,b,c,d,e,f},x] && EqQ[a^2+b^2,0]

2:  ∫((c+d x)/(Sqrt[a+b Tan[e+f x]]))dx  when  (a^2)+(b^2)≠0

Derivation: Integration by parts

Basis: (1/(Sqrt[a+b Tan[e+f x]]))==-(i/(f (Sqrt[a-i b]))) (∂_x)ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a-i b]))]+(i/(f (Sqrt[a+i b]))) (∂_x)ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a+i b]))]

Rule: If  (a^2)+(b^2)≠0, then

∫((c+d x)/(Sqrt[a+b Tan[e+f x]]))dx  ⟶  
-((i (c+d x))/(f (Sqrt[a-i b]))) ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a-i b]))]+((i (c+d x))/(f (Sqrt[a+i b]))) ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a+i b]))]+
((i d)/(f (Sqrt[a-i b]))) ∫ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a-i b]))]dx-((i d)/(f (Sqrt[a+i b]))) ∫ArcTanh[((Sqrt[a+b Tan[e+f x]])/(Sqrt[a+i b]))]dx

Program code:

Int[(c_.+d_.*x_)/Sqrt[a_.+b_.*tan[e_.+f_.*x_]],x_Symbol] :=
  -I*(c+d*x)/(f*Rt[a-I*b,2])*ArcTanh[Sqrt[a+b*Tan[e+f*x]]/Rt[a-I*b,2]] + 
  I*(c+d*x)/(f*Rt[a+I*b,2])*ArcTanh[Sqrt[a+b*Tan[e+f*x]]/Rt[a+I*b,2]] + 
  I*d/(f*Rt[a-I*b,2])*Int[ArcTanh[Sqrt[a+b*Tan[e+f*x]]/Rt[a-I*b,2]],x] - 
  I*d/(f*Rt[a+I*b,2])*Int[ArcTanh[Sqrt[a+b*Tan[e+f*x]]/Rt[a+I*b,2]],x] /;
FreeQ[{a,b,c,d,e,f},x] && NeQ[a^2+b^2,0]

X:  ∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx

Basis: Tan[e+f x]==-Cot[e-(π/2)+f x]

Basis: Tan[e+f x]==i Tanh[-i e-i f x]

Basis: Tan[e+f x]==i Coth[-i (e-(π/2))-i f x]

Rule:

∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx  ⟶  ∫(((c+d x))^m) (((a+b Tan[e+f x]))^n) dx

Program code:

Int[(c_.+d_.*x_)^m_.*tan[e_.+f_.*x_]^n_.,x_Symbol] :=
  If[MatchQ[f,f1_.*Complex[0,j_]],
    If[MatchQ[e,e1_.+Pi/2],
      I^n*Unintegrable[(c+d*x)^m*Coth[-I*(e-Pi/2)-I*f*x]^n,x],
    I^n*Unintegrable[(c+d*x)^m*Tanh[-I*e-I*f*x]^n,x]],
  If[MatchQ[e,e1_.+Pi/2],
    (-1)^n*Unintegrable[(c+d*x)^m*Cot[e-Pi/2+f*x]^n,x],
  Unintegrable[(c+d*x)^m*Tan[e+f*x]^n,x]]] /;
FreeQ[{c,d,e,f,m,n},x] && IntegerQ[n]

Int[(c_.+d_.*x_)^m_.*(a_.+b_.*tan[e_.+f_.*x_])^n_.,x_Symbol] :=
  Unintegrable[(c+d*x)^m*(a+b*Tan[e+f*x])^n,x] /;
FreeQ[{a,b,c,d,e,f,m,n},x]

N:  ∫(u^m)(((a+b Tan[v]))^n)dx  when  u==c+d x ∧ v==e+f x

Derivation: Algebraic normalization

Rule: If  u==c+d x ∧ v==e+f x, then

∫(u^m)(((a+b Tan[v]))^n)dx  ⟶  ∫(((c+d x))^m) (((a+b Tan[e+f x]))^n)dx

Program code:

Int[u_^m_.*(a_.+b_.*Tan[v_])^n_.,x_Symbol] :=
  Int[ExpandToSum[u,x]^m*(a+b*Tan[ExpandToSum[v,x]])^n,x] /;
FreeQ[{a,b,m,n},x] && LinearQ[{u,v},x] && Not[LinearMatchQ[{u,v},x]]

Int[u_^m_.*(a_.+b_.*Cot[v_])^n_.,x_Symbol] :=
  Int[ExpandToSum[u,x]^m*(a+b*Cot[ExpandToSum[v,x]])^n,x] /;
FreeQ[{a,b,m,n},x] && LinearQ[{u,v},x] && Not[LinearMatchQ[{u,v},x]]